<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<%@include file="/WEB-INF/jsp/base/head.jsp"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>增加编码</title>
</head>
<body>
<div class="center_main"></div>
  <div id="page-top">
  	<span>增加编码</span>
  	<b></b><i></i>
  </div>
  
    <div id="page">

       <s:form action="codeAction!codeAdd.do" namespace="/code" name="form1" method="post" >
           <div class="edit-wapper">
		       <label class="lab">编码添加方式：</label>
		       <s:radio list="%{codeTypeList}" onclick="changeCodeType($(this).val())" name="codeType"  listKey="code" listValue="text" value="%{codeType}"  ></s:radio>
	       </div>
	       <div class="edit-wapper" <s:if test="%{codeType==2}">style="display:none"</s:if> id="codeNameId">
	       		<label class="lab">编码名称：</label>
	       		<input type="text" name="codeName" id="codeName" class="inputText" maxlength="30" value="${codeName }"  style="width: 450px" />
	       		<label class="error" >*&nbsp;&nbsp;<s:property value="%{errors['codeName'][0]}"/></label>
	       </div>
	       <div class="edit-wapper" <s:if test="%{codeType==1}">style="display:none"</s:if> id="ddlcodeNameId" >
	      		<label class="lab">编码名称：</label>
				<s:select list="%{codeNameList}" id="ddlCodeName" name="codeBizBean.codeName" value="codeBizBean.codeName" />		      
				<label class="error" >*&nbsp;&nbsp;<s:property value="%{errors['codeName'][0]}"/></label>
	       </div>
	       
	        <div class="edit-wapper">
				<label class="lab">编码键名：</label>	        	
				<input type="text" name="codeBizBean.codeKey" id="codeKey" class="inputText" maxlength="30" value="${codeBizBean.codeKey }"  style="width: 450px"/>
				<label class="error" >*&nbsp;&nbsp;<s:property value="%{errors['codeKey'][0]}"/></label>
	        </div>
	        <div class="edit-wapper">
	        	<label class="lab">编码值：</label>
	        	<input type="text" name="codeBizBean.codeValue" id="codeValue" maxlength="100" class="inputText" value="${codeBizBean.codeValue}" style="width: 450px"/>
	        	<label class="error" >*&nbsp;&nbsp;<s:property value="%{errors['codeValue'][0]}"/></label>
	        </div>
	        <div class="edit-wapper">
	        	<label class="lab">备注：</label>
	        	<textarea name="codeBizBean.remark" id="remark" class="inputText" onkeyup="return isMaxLen(this);" maxlength="100" style="width: 450px">${codeBizBean.remark}</textarea>
	        	<label class="error" >*&nbsp;&nbsp;<s:property value="%{errors['remark'][0]}"/></label>
	        </div>
	       
           <div class="btn-wapper">
           	   <s:submit cssClass="form-btn" value="保存" id="btnEnter"/>
           	   <s:submit cssClass="form-btn" value="返回" action="codeAction!getCodeList"></s:submit>
	       </div>
       </s:form>
       
    </div>
    <div id="page-bottom">
     <b></b><i></i>
    </div> 
</body>
<script type="text/javascript">
function changeCodeType(v){
	if(v==1) {
		document.getElementById("ddlcodeNameId").style.display="none";
		document.getElementById("codeNameId").style.display="";
	}else{
		document.getElementById("ddlcodeNameId").style.display="";
		document.getElementById("codeNameId").style.display="none";
	}
}
</script>
</html>